﻿using System.Collections;

public class Singleton<T>
    where T : new()
{

    protected Singleton() { }

    public static T singleton
    {
        get
        {
            if (null == s_singleton)
            {
                //lock(s_objectLock)
                {
                    if (null == s_singleton)
                    {
                        s_singleton = new T();
                    }
                }
            }
            return s_singleton;
        }
    }

    private static T s_singleton = default(T);
    //private static object s_objectLock = new object();
}
